unit UfrmClientStorage;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, DB, ADODB, ExtCtrls, RzPanel, DBGridEhGrouping, RzButton,
  StdCtrls, Mask, RzEdit, RzLabel, GridsEh, DBGridEh;

type
  TfrmClientStorage = class(TForm)
    RzPanel1: TRzPanel;
    qryClientStorage: TADOQuery;
    dsClientStorage: TDataSource;
    DBGridEh1: TDBGridEh;
    RzStatusBar1: TRzStatusBar;
    RzLabel1: TRzLabel;
    RzEdit1: TRzEdit;
    RzBitBtn1: TRzBitBtn;
    RzButton1: TRzButton;
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure RzBitBtn1Click(Sender: TObject);
    procedure RzButton1Click(Sender: TObject);
  private
    Fclientid:integer;
  public
    { Public declarations }
  end;

var
  frmClientStorage: TfrmClientStorage;

implementation

uses UdataModel, UfrmClientSeacher;

{$R *.dfm}

procedure TfrmClientStorage.FormClose(Sender: TObject;
  var Action: TCloseAction);
begin
  Action:=caFree;
end;

procedure TfrmClientStorage.RzBitBtn1Click(Sender: TObject);
begin
   with TfrmClientSearch.Create(nil) do
   begin
        try
          ShowModal;
          FclientID:=Clientid;
          RzEdit1.Text:=ClientName;
        finally
           Free;
        end;

   end;
end;

procedure TfrmClientStorage.RzButton1Click(Sender: TObject);
begin
   qryClientStorage.Close;
   qryClientStorage.Parameters.ParamByName('clientid').Value:=Fclientid;
   qryClientStorage.Open;
end;

end.
